
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { instancelogin } from '../../api/modules/user'
export const userCounterStore = defineStore('user', () => {
  const token = ref('')
  const settoken = (newvalue) => {
    token.value = newvalue
  }
  const removetoken = () => {
    token.value = ''

  }
  async function asyncLogin(data) {

    return await instancelogin(data)
    // console.log(res, "-------------");
  }


  return { token, settoken, removetoken, asyncLogin }
}, {
  persist: true,
})
